﻿using FinalTestMachine.Motion.Process;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfZMotion_AAControl.Core.Tools
{
    public class PipeController
    {
        public static readonly PipeController Cur= new PipeController();
        public static PipeController CreateInstance()
        {
            return Cur;
        }
        private PipeController() {
            //第二张运动控制卡，用于专门控制光管
            pipeInstance = new Pipes.PipesManager("192.168.0.11", "pipeGroup1");
        }

        public Pipes.PipesManager pipeInstance;

        private string ErrInfo_Pipe = "";
        public bool AllHome()
        {
            if (pipeInstance.Fun_HomeAll(out ErrInfo_Pipe))
            {
                return true;
            }
            else
            {
                Process_AutoRun.Cur.WriteErrToUser(ErrInfo_Pipe);
                return false;
            }
        }

        public void AllWait()
        {
            pipeInstance.Fun_MovWaitAll();
        }
    }
}
